package com.leaf.u_spring.chapter03;

import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;

/**
 * value=WebApplicationContext.SCOPE_SESSION值是session，每个会话会创建一个ShoppingCart
 * proxyMode=ScopedProxyMode.INTERFACES创建类的代理，确保当前购物车就是当前会话所对应的那一个，而不是其他用户
 * 
 * XML的配置
 * <bean id="cart" class="com.leaf.u_spring.chapter03.ShoppingCart" scope="session">
 * 		<aop:scoped-proxy />
 * </bean>
 * 
 * 使用的是CGLib生成代理类
 */
@Component
@Scope(value=WebApplicationContext.SCOPE_SESSION,
		proxyMode=ScopedProxyMode.INTERFACES)
public class ShoppingCart {

	
}
